SpatialStream® Code Examples

State Boundaries and Labels

Using SpatialStream® State Boundaries, SLD, and GetMap components, you can access nationwide state boundaries and basic attributes for display in your mapping application. This example will demonstrate how to add state boundaries and state name labels for the entire US (Southern California shown in sample). The SLD (Stylized Layer Descriptor) component allows you to add labels based on attributes in the state boundaries data set and tailor the following display parameters of your state border: boundary color, boundary width, fill color, opacity, label color, and label size. Once the SLD is defined, the GetMap component generates the overlay for your map.

State Boundaries | GetMap | SLD

var state = new Dmp.Layer.WMSLayer("boundary", "SS", {
ignoreHoles: true, antiAlias: true
});
state.addChild("statePoly", "DMP_LICENSE/State", "$(ACCOUNT_FOLDER)SLD/SimpleBoundary.sld.xml", {
zoomRange: {
min: 2, max: 19
}
});
state.addChild("stateLabel", "DMP_LICENSE/State", "$(ACCOUNT_FOLDER)SLD/StateLabel.sld.xml", {
zoomRange: {
min: 5, max: 19
}
});
map.addLayer(state);


Run Sample   View Video   Back To Index